﻿<Window x:Class="SettingsDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:my="clr-namespace:Dzonny.UnicodeScreenSaver"
        xmlns:tm="clr-namespace:Tools.WindowsT.WPF.MarkupT;assembly=Tools.Windows"
        mc:Ignorable="d"
        Title="SettingsDialog" Height="300" Width="395">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>

        <Label    Grid.Row="0" Grid.Column="0"                     >Interval [s]</Label>
        <TextBox  Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" Text="{Binding Interval, Mode=TwoWay}" VerticalAlignment="Center"/>

        <Label    Grid.Row="1" Grid.Column="0"                     xml:space="preserve">Font source&#xD;&#xa;(empty for font installed in system)</Label>
        <TextBox  Grid.Row="1" Grid.Column="1"                     Text="{Binding FontPath, Mode=TwoWay}" VerticalAlignment="Center" Name="txtFontPath" TextChanged="txtFontPath_TextChanged" />
        <Button   Grid.Row="1" Grid.Column="2"                     HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5,0,5,2" Click="btnFontBrowse_Click">...</Button>
        <Button   Grid.Row="1" Grid.Column="3" Grid.RowSpan="2"    HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5,0,5,2" Click="btnFontDefault_Click">Default</Button>

        <Label    Grid.Row="2" Grid.Column="0"                     >Font name</Label>
        <ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding FontName, Mode=TwoWay}" VerticalAlignment="Center" IsEditable="True" Name="cmbFonts"/>

        <Label    Grid.Row="3" Grid.Column="0"                     >Background color</Label>
        <Label    Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3" TextBlock.TextAlignment="Center" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" MouseLeftButtonUp="lblBgColor_MouseLeftButtonUp" Name="lblBgColor">
            <Label.Background>
                <SolidColorBrush Color="{Binding BackgroundColor, FallbackValue=Black}"/>
            </Label.Background>
            <Label.Foreground>
                <SolidColorBrush Color="{Binding ForegroundColor, FallbackValue=Yellow}"/>
            </Label.Foreground>
            Click to change
        </Label>

        <Label    Grid.Row="4" Grid.Column="0"                     >Foreground color</Label>
        <Label    Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" TextBlock.TextAlignment="Center" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" MouseLeftButtonUp="lblFgColor_MouseLeftButtonUp" Name="lblFgColor">
            <Label.Background>
                <SolidColorBrush Color="{Binding BackgroundColor, FallbackValue=Black}"/>
            </Label.Background>
            <Label.Foreground>
                <SolidColorBrush Color="{Binding ForegroundColor, FallbackValue=Yellow}"/>
            </Label.Foreground>
            Click to change
        </Label>

        <Label    Grid.Row="5" Grid.Column="0"                     >Sorting alghoritm</Label>
        <ComboBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3" SelectedValue="{Binding SortingAlghoritm, FallbackValue={x:Static my:SortingAlghoritm.RandomCharacter}}" ItemsSource="{tm:EnumItems {x:Type my:SortingAlghoritm}}"/>

        <Button   Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="10,3" Margin="22,0" Click="btnConvertCompositeFont_Click">
            <TextBlock TextWrapping="Wrap">
                Convert <Hyperlink NavigateUri="http://www.babelstone.co.uk/Software/BabelMap.html" Click="Hyperlink_Click">BabelMap</Hyperlink> composite font to .NET/WPF composite font...
            </TextBlock>
        </Button>

        <Button   Grid.Row="7" Grid.Column="0"                     IsDefault="True" Click="OK_Click" HorizontalAlignment="Center" MinWidth="60">OK</Button>
        <Button   Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="3" IsCancel="True" Click="Cancel_Click" HorizontalAlignment="Center" MinWidth="60">Cancel</Button>
    </Grid>
</Window>
